﻿@model string
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using P2PWeb;
@using P2PWeb.Common;

<link href="@Url.Content("~/Content/SignIn_Style.css")" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="@Url.Content("~/Scripts/app/Validate.js")"></script>

<script type="text/javascript">
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)
            return unescape(r[2]);
        return null;
    }

    function change_rand() {
        $("img.validate").attr('src', '/Login/ValidateCode?d=' + new Date().getTime());
    }
    function Validate() {
        var Name = $("#Name");
        var PassWord = $("#PassWord");
        var Srand = $("#srand");
        if (Name.val().trim() == "") {
            alert("请输入用户名");
            Name.focus();
            return false;
        }
        else if (PassWord.val().trim() == "") {
            alert("请输入密码");
            PassWord.focus();
            return false;
        }
        else if (Srand.val().trim() == "") {
            alert("请输入验证码");
            Srand.focus();
            return false;
        }
        return true;
    }

    $(function () {
        $("#btnSubmit").click(function () {
            var isSubmit = true;
            var name = $("#Name").val();
            var passWord = $("#PassWord").val();
            var srand = $("#srand").val();
            var backUrl = document.referrer;
            var isTrue = Validate();
            if (isTrue) {
                $.ajax({
                    type: "post",
                    url: "/Login/ValidateForm",
                    data: { Name: name, PassWord: passWord, Srand: srand },
                    success: function (data) {
                        if (data == "sucess")
                            if (($('#urlReferrer').val() + "").length > 0 && $('#urlReferrer').val().indexOf("/Lenders/LendrsDetail") != -1) {
                                window.location = $('#urlReferrer').val();
                            }
                            else {
                                window.location = '/home';
                            }
                        else {
                            alert(data);
                            change_rand();
                        }
                    }
                })
            }
            return false;
        });
    });

</script>
<div class="main" style="margin-top:130px;">
    <div class="main_top"><span class="main_top_right"></span></div>
    <div class=" pt0 pb0 pr30 pl30" style="height: 430px;">
        <div class="login_main w">
            <form class="login_from ml540 mt15" action="/Login/SignIn" method="post" name="theform" id="theform">
                <h3 class="register_login_tit">注册升付金融账户</h3>
                <div class="counterBox_row clearfix pt20 col666">
                    <div class="w60 fl tr">
                        <label class="label_text" for="username">账&nbsp;&nbsp;户</label>
                    </div>
                    <div class=" tl pl70">
                        <input type="text" class="input_text w240" maxlength="50" name="Name" id="Name" value="" placeholder="请输入邮箱/手机号">
                    </div>
                </div>
                <div class="counterBox_row clearfix pt5 warn_text">
                    <div class="w60 fl tr">
                        <label class="">&nbsp;</label>
                    </div>
                    <div class=" tl pl70 pl100_ie6 colred4 s_nick_user" id="s_nick_user"></div>
                </div>
                <div class="counterBox_row clearfix pt5 col666">
                    <div class="w60 fl tr">
                        <label class="label_text" for="password">密&nbsp;&nbsp;码</label>
                    </div>
                    <div class=" tl pl70">
                        <input class="input_text w240" maxlength="16" name="PassWord" id="PassWord" type="password" placeholder="请输入密码">
                    </div>
                </div>
                <div class="counterBox_row clearfix pt5 warn_text">
                    <div class="w60 fl tr">
                        <label class="">&nbsp;</label>
                    </div>
                    <div class=" tl pl70 pl100_ie6 colred4 s_user_pwd1" id="s_user_pwd1"></div>
                </div>
                <div class="counterBox_row clearfix pt5 col666">
                    <div class="w60 fl tr">
                        <label class="label_text" for="srand">验证码</label>
                    </div>
                    <div class=" tl pl70">
                        <input type="text" class="input_text w80px" maxlength="4" id="srand" name="srand" placeholder="验证码">
                        <img class="validate ml10 vt dib vm_ie7 " src="/Login/ValidateCode" title="点击图片刷新验证码" onclick="change_rand();" name="srand">
                        <a class="col666 ml10 vt_ie7 dib" href="javascript:change_rand();">看不清？换图片</a>
                    </div>
                </div>
                <div class="counterBox_row clearfix pt5 warn_text">
                    <div class="w60 fl tr">
                        <label class="">&nbsp;</label>
                    </div>
                    <div class=" tl pl70 pl100_ie6 colred4 s_srand" id="s_srand"></div>
                </div>
                <div class="counterBox_row clearfix pt5 col666">
                    <div class="w60 fl tr">
                        <label>&nbsp;</label>
                    </div>
                    <div class=" tl pl70">
                        <label class="vv">
                            <input type="checkbox" class="vv" id="rememberMe" name="rememberMe">记住用户名</label>
                    </div>
                </div>
                <div class="counterBox_row clearfix pt5 col666">
                    <div class="w60 fl tr">
                        <label class="label_text">&nbsp;</label>
                    </div>
                    <div class=" tl pl70">
                        <input type="submit" id="btnSubmit" class="login_btn b0 fl hand" value="登录" />
                        <a class="colblue1 pl10 pt10 fl" href="/Login/ForgetPassword">忘记密码？</a>
                        <a class=" colblue1 pl10 pt10 fl" href="/Login/Register">免费注册</a>
                        <input type="hidden" name="fromSite" id="fromSite" value="YRD" />
                        <input id="tourl" name="tourl" type="hidden" value="" />
                        <input id="lastPage" name="lastPage" type="hidden" value="http://www.yirendai.com/LenderApplyListAction/applyInfoListPage.action" />
                    </div>
                </div>
            </form>

        </div>
    </div>
    <div class="main_bottom"><span class="main_bottom_right"></span></div>
</div>
